local scene = gamestate.new()

function scene:enter(from,roomID)
    collectgarbage("collect")
	delay:new(0.1,function()
		net.client:send("need_init",{id = roomID})
	end)
	self.game = game_mode.client(roomID)
	self.roomID = roomID
	net.inGame = true
end

function scene:update(dt)
    self.game:update(dt)
end

function scene:draw()
    self.game:draw()
    suit.draw()
end

function scene:keypressed(k)
	if k == "escape" then
		net.client:send("leave_room",{id = self.roomID})
		net.inGame = false
		gamestate.switch(gameState.title)
		sound:stopAll()
	end
end

return scene